﻿using Microsoft.AspNetCore.Mvc;
using WLYT.Application.Interfaces;
using WLYT.Domain.Model;

namespace WLYT.WMS.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AuthController(IAuthService authService) : ControllerBase
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<LoginResult> Login([FromBody] LoginRequest request)
        {
            var result = await authService.Login(request.Name, request.Password);
            return result;
        }
    }
}
